﻿Handlebars.getTemplate = function (name) {
    if (Handlebars.template === undefined || Handlebars.template[name] === undefined) {
        $.ajax({
            url: '/MyScripts/template/' + name + '.html',
            success: function (data) {
                if (Handlebars.template === undefined) {
                    Handlebars.template = {};
                }
                Handlebars.template[name] = Handlebars.compile(data);
            },
            async: false
        });
    }
    return Handlebars.template[name];
};